Skip to content

EPMRPP-109375 || Fix the default agent params overriding via 'restClientConfig.agent' option#241

Merged
AmsterGet merged 1 commit intodevelopfrom
bugfix/EPMRPP-109375-Cannot-override-the-default-agent-params-via-'restClientConfig.agent'-option-
Nov 13, 2025
Merged

EPMRPP-109375 || Fix the default agent params overriding via 'restClientConfig.agent' option#241
AmsterGet merged 1 commit intodevelopfrom
bugfix/EPMRPP-109375-Cannot-override-the-default-agent-params-via-'restClientConfig.agent'-option-

Conversation

@AmsterGet
Copy link
Member

@AmsterGet AmsterGet commented Nov 13, 2025

Fix for reportportal/agent-js-playwright#193

Summary by CodeRabbit

  • Bug Fixes
    • Improved proxy agent handling to correctly recognize and respect explicitly configured custom agents, preventing automatic proxy resolution from overriding user-specified agent configurations.

@AmsterGet AmsterGet merged commit db820ee into develop Nov 13, 2025
5 of 7 checks passed
@AmsterGet AmsterGet deleted the bugfix/EPMRPP-109375-Cannot-override-the-default-agent-params-via-'restClientConfig.agent'-option- branch November 13, 2025 11:34
@coderabbitai
Copy link

coderabbitai bot commented Nov 13, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The change modifies RestClient.request to treat an explicit agent property in restClientConfig as a custom agent, alongside existing checks for httpsAgent and httpAgent. When any of these three custom agents are present, proxy agent resolution is skipped; otherwise, per-URL proxy resolution is performed.

Changes

Cohort / File(s) Summary
Proxy Agent Selection Logic
lib/rest.js
Expanded the condition in RestClient.request to recognize agent property as a custom agent alongside httpsAgent and httpAgent. When any of these custom agents are present, proxyAgents is set to {} to skip per-URL proxy resolution. Updated accompanying comment to reflect the expanded set of recognized custom agents.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Attention areas:
    • Verify the proxy agent selection logic handles all three agent properties (agent, httpsAgent, httpAgent) correctly and consistently
    • Ensure the change doesn't inadvertently break existing proxy behavior for configurations using only httpsAgent or httpAgent
    • Confirm the updated comment accurately reflects the new condition logic

Possibly related PRs

Poem

🐰 A hop through the agents three—
Agent, HTTPS, and HTTP we see!
When custom ones come to stay,
Proxy resolution skips away!
Simplified logic, clear as can be! 🎉

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix/EPMRPP-109375-Cannot-override-the-default-agent-params-via-'restClientConfig.agent'-option-

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 440a4e3 and 6f64d9e.

📒 Files selected for processing (1)
  • lib/rest.js (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

AmsterGet added a commit that referenced this pull request Nov 13, 2025
* 5.5.3 -> 5.5.4-SNAPSHOT

* Remove GitHub packages registry publishing

* EPMRPP-109375 || Fix the default agent params overriding via 'restClientConfig.agent' option (#241)

* Update changelog

---------

Co-authored-by: reportportal.io <reportportal.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant